package com.dz.syndata.task;

import com.dz.syndata.service.IDevice4DtzzService;
import com.dz.syndata.service.IDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling
public class TimerTask {
    @Autowired
    IDeviceInfoService mDeviceInfoService;
    @Autowired
    IDevice4DtzzService iDevice4DtzzService;
    /**
     * 默认是fixedDelay 上一次执行完毕时间后执行下一轮
     * 每小时10分执行该方法
     */
    @Scheduled(cron = "0 10 * * * * ")
    public void run() throws InterruptedException {
        mDeviceInfoService.updateDeviceData();
        iDevice4DtzzService.selectSbyjData();
    }


}
